﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManageAdmin.aspx.cs" Inherits="Manageweb_ManageAdmin" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    
<link href="images/css.css" rel="stylesheet" type="text/css" />
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table width="750" border="1" cellspacing="0" cellpadding="0">
      <tr>
        <td style="background-color:#507cd1; color:White; font-weight:bold; text-align:left;">
            &nbsp;管理管理员&nbsp;<asp:Label ID="LB_Role" runat="server" Visible="False"></asp:Label></td>
      </tr>
    </table>
    <br />
        <table border="1" cellpadding="0" cellspacing="0" width="750" id="TABLE_Add" runat="server">
            <tr>
                <td colspan="2" style="background-color:#507cd1; color:White; font-weight:bold; text-align:left;">
                    &nbsp;添加管理员</td>
            </tr>
            <tr>
                <td style="width:150px;">
                    &nbsp;账号</td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_LoginID" runat="server" Width="240px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RFV_TB_Title" runat="server" ControlToValidate="TB_LoginID"
                        Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td>
                    &nbsp;密码</td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_Pass" runat="server" TextMode="Password" Width="240px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RFV_TB_Pass" runat="server" ControlToValidate="TB_Pass"
                        Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator><asp:CompareValidator
                            ID="CV_Pass" runat="server" ControlToCompare="TB_Pass" ControlToValidate="TB_RePass"
                            Display="Dynamic" ErrorMessage="两次密码输入不一致" ValidationGroup="Btn_Submit"></asp:CompareValidator></td>
            </tr>
            <tr>
                <td>
                    &nbsp;确认密码</td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_RePass" runat="server" Width="240px" TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RFV_TB_RePass" runat="server" ControlToValidate="TB_RePass"
                        Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td>
                    &nbsp;级别</td>
                <td style="text-align: left">
                    &nbsp;<asp:DropDownList ID="DDL_Role" runat="server" Width="246px">
                        <asp:ListItem></asp:ListItem>
                        <asp:ListItem Value="2">网站管理员</asp:ListItem>
                        <asp:ListItem Value="3">员工</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RFV_DDL_Role" runat="server" ControlToValidate="DDL_Role"
                        Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td>
                    &nbsp;昵称</td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_Name" runat="server" Width="240px"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
                    &nbsp;选项</td>
                <td style="text-align: left">
                    &nbsp;<asp:CheckBox ID="CB_IsLock" runat="server" Checked="True" Text="是否启用" /></td>
            </tr>
            <tr>
                <td colspan="2" style="background-color:#507cd1; color:White; font-weight:bold; text-align:center;">
                    <asp:Button ID="Btn_Add" runat="server" Text="提交" OnClick="Btn_Add_Click" ValidationGroup="Btn_Submit" />&nbsp;
                    <asp:Button ID="Btn_Cancel" runat="server" Text="取消" /></td>
            </tr>
        </table>
        <table border="1" cellpadding="0" cellspacing="0" width="750" id="TABLE_ModPass" runat="server">
            <tr>
                <td colspan="2" style="background-color:#507cd1; color:White; font-weight:bold; text-align:left;">
                    &nbsp;修改密码<asp:Label ID="LB_ID" runat="server" Visible="False"></asp:Label></td>
            </tr>
            <tr>
                <td style="width: 150px">
                    &nbsp;原密码</td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_OldPass" runat="server" TextMode="Password" Width="240px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RFV_TB_OldPass" runat="server" ControlToValidate="TB_OldPass"
                        Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_ModPass"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td>
                    &nbsp;新密码</td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_NewPass" runat="server" TextMode="Password" Width="240px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RFV_TB_NewPass" runat="server" ControlToValidate="TB_NewPass"
                        Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_ModPass"></asp:RequiredFieldValidator><asp:CompareValidator
                            ID="CV_NewPass" runat="server" ControlToCompare="TB_NewPass" ControlToValidate="TB_NewPassRe"
                            Display="Dynamic" ErrorMessage="两次密码输入不一致" ValidationGroup="Btn_ModPass"></asp:CompareValidator></td>
            </tr>
            <tr>
                <td>
                    &nbsp;确认新密码</td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_NewPassRe" runat="server" TextMode="Password" Width="240px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RFV_TB_NewPassRe" runat="server" ControlToValidate="TB_NewPassRe"
                        Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_ModPass"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td colspan="2" style="background-color:#507cd1; color:White; font-weight:bold; text-align:center;">
                    <asp:Button ID="Btn_ModPass" runat="server" Text="提交" ValidationGroup="Btn_ModPass" OnClick="Btn_ModPass_Click" />&nbsp;
                    <asp:Button ID="Btn_Cancel2" runat="server" Text="取消" /></td>
            </tr>
        </table>
    <br />
    <asp:Label ID="LB_ManageAdmin" runat="server" Font-Bold="True" Font-Size="Small" ForeColor="Red"></asp:Label><table border="1" cellpadding="0" cellspacing="0" width="750">
            <tr>
                <td>
                    <asp:GridView ID="GV_MasterList" runat="server" AutoGenerateColumns="False" CellPadding="4"
                        DataKeyNames="Master_ID" DataSourceID="ODS_MasterList" ForeColor="#333333" Width="100%">
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <Columns>
                            <asp:BoundField DataField="Master_ID" HeaderText="Master_ID" InsertVisible="False"
                                ReadOnly="True" SortExpression="Master_ID" Visible="False" />
                            <asp:BoundField DataField="Master_LoginID" HeaderText="账号" SortExpression="Master_LoginID" />
                            <asp:BoundField DataField="Master_Role" HeaderText="角色级别" SortExpression="Master_Role" />
                            <asp:CheckBoxField DataField="Master_IsLock" HeaderText="是否启用" SortExpression="Master_IsLock" />
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:LinkButton ID="LBtn_Add" runat="server" OnCommand="LBtn_Add_Command">添加</asp:LinkButton>
                                    <asp:LinkButton ID="LBtn_Mod" runat="server" CommandArgument='<%# Eval("Master_ID") %>'
                                        OnCommand="LBtn_Mod_Command">修改</asp:LinkButton>
                                    <asp:LinkButton ID="LBtn_Del" runat="server" CommandArgument='<%# Eval("Master_ID") %>'
                                        OnCommand="LBtn_Del_Command" OnClientClick="return confirm('删除操作不可恢复，是否继续？')">删除</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Master_LastTime" HeaderText="最后登录时间" SortExpression="Master_LastTime" />
                        </Columns>
                        <RowStyle BackColor="#EFF3FB" />
                        <EmptyDataTemplate>
                            <asp:Button ID="Btn_Add" runat="server" OnCommand="LBtn_Add_Command" Text="添加管理员" />
                        </EmptyDataTemplate>
                        <EditRowStyle BackColor="#2461BF" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <AlternatingRowStyle BackColor="White" />
                        <EmptyDataRowStyle BackColor="#507CD1" />
                    </asp:GridView>
                    <asp:ObjectDataSource ID="ODS_MasterList" runat="server" OldValuesParameterFormatString="original_{0}"
                        SelectMethod="GetDataByRole" TypeName="AccessDAL.MasterTableAdapters.MasterTableAdapter">
                        <SelectParameters>
                            <asp:Parameter DefaultValue="false" Name="Master_IsDel" Type="Boolean" />
                            <asp:ControlParameter ControlID="LB_Role" DefaultValue="" Name="Master_Role" PropertyName="Text"
                                Type="Int32" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
